import {
	myRequest
} from '../http.js'
import qs from 'qs'
//登录
export function login(data) {
	return myRequest({
		url: "/login/login",
		method: 'post',
		data: qs.stringify(data)
	})
}
export function userlogout() {
	return myRequest({
		url: "/login/quit",
		method: 'post',
	})
}
// 公司用户
export function regis_company(data) {
	return myRequest({
		url: "/Register/company",
		method: 'post',
		data: qs.stringify(data)
	})
}
//个人用户
export function regis_person(data) {
	return myRequest({
		url: "/register/person",
		method: 'post',
		data: qs.stringify(data)
	})
}
export function getcart_list() {
	return myRequest({
		url: '/cart/cart_list?lang=cn',
		method: 'get'
	})
}
export function getquote_list() {
	return myRequest({
		url: '/quote/quote_list?lang=cn',
		method: 'get'
	})
}
//获取个人信息
export function getinformation() {
	return myRequest({
		url: '/information/information?lang=cn',
		method: 'get'
	})
}
//获取我的商品
export function getMinegoods(data) {
	return myRequest({
		url: `/mine/mine?lang=cn&company_id=${data.company_id}&id=${data.id}&successively=${data.successively}&brand=${data.brand}&sort=${data.sort}&page=${data.page}&search=${data.search}`,
		method: 'get'
	})
}
export function getMinegoodscate(data) {
	return myRequest({
		url: `/index/cate?lang=cn&id=${data.id}&brand_id=${data.brand_id}`,
		method: 'get'
	})
}
export function getMinegoodsbrand(data) {
	return myRequest({
		url: `/mine/brand?lang=cn&id=${data.id}&brand_id=${data.brand_id}`,
		method: 'get'
	})
}
//获取我的收藏
export function mycollection(data) {
	return myRequest({
		url: `/collection/collection_list?lang=cn&search${data.search}=&page=${data.page}&type=${data.type}`,
		method: 'get'
	})
}
//我的收藏加入报价车
export function addquoteall(data) {
	return myRequest({
		url: `/collection/add_quote_all`,
		method: 'post',
		data: qs.stringify(data)
	})
}
//我的收藏加入购物车
export function addcartall(data) {
	return myRequest({
		url: `/collection/add_cart_all`,
		method: 'post',
		data: qs.stringify(data)
	})
}
//我的收藏取消收藏
// collection_id[0]: 3602
// collection_id[1]: 3601
export function colledel(data) {
	return myRequest({
		url: `/collection/delete`,
		method: 'post',
		data: qs.stringify(data)
	})
}
//我的订单
// lang: cn
// release:
// relend:
// order_sn:
// department:
// user_id:
// status:
// orstatus:
// sortAttr:
// sortMode:
// page: 1
//获取我的订单
export function myorders(data) {
	return myRequest({
		url: '/orderstatus/order_status',
		method: 'post',
		data: data
	})
}
//获取订单详情
export function orderdetils(data) {
	return myRequest({
		url: "/orderstatus/goods",
		method: "post",
		data: data
	})
}
//申请退货
export function returngood(data) {
	return myRequest({
		url: '/orderstatus/return_goods',
		method: 'post',
		data: data
	})
}
//申请取消
export function cancelgood(data) {
	return myRequest({
		url: '/orderstatus/return_cancel',
		method: 'post',
		data: data
	})
}
//再次下单
export function againcart(data) {
	return myRequest({
		url: '/orderstatus/cart',
		method: 'post',
		data: qs.stringify(data)
	})
}
//取消报价
export function delquote(data) {
	return myRequest({
		url: '/quote/delete',
		method: 'post',
		data: data
	})
}
//报价车商品加减
export function changequotegoods(data) {
	return myRequest({
		url: '/quote/change',
		method: 'post',
		data: data
	})
}
//报价车提交
// goods[0]: 12944
// goods[1]: 12943
// postscript:
export function addquoteorder(data) {
	return myRequest({
		url: '/quote/add',
		method: 'post',
		data: data
	})
}

//报价车加入购物车
export function addquotecart(data) {
	return myRequest({
		url: "/quoteorder/cart",
		method: "post",
		data: qs.stringify(data)
	})
}

//支付状态
export function paystatus(data) {
	return myRequest({
		url: '/paystatus/pay_status',
		method: "post",
		data: data
	})
}
//获取报价车订单
export function getquoteorder(data) {
	return myRequest({
		url: "/quoteorder/quote_list",
		method: "post",
		data: data
	})
}

export function quoteorderDetails(data) {
	return myRequest({
		url: '/quoteorder/goods',
		method: 'post',
		data: data
	})
}
//訂單月匯總
export function ordermonth(data) {
	return myRequest({
		url: '/order/order',
		method: 'post',
		data:qs.stringify(data)
	})
}
//訂單月匯總详情
export function ordermonthdetail(data) {
	return myRequest({
		url: '/order/month_list',
		method: 'post',
		data:qs.stringify(data)
	})
}
//关于我们
export function aboutus() {
	return myRequest({
		url: '/header/column?lang=cn&id=1',
		method: 'get'
	})
}
//企业文化
export function companyculture() {
	return myRequest({
		url: '/header/column?lang=cn&id=7',
		method: 'get'
	})
}
//用户已存在
export function userexist(data) {
	return myRequest({
		url: '/register/check_user',
		method: 'post',
		data:qs.stringify(data)
	})
}
//拨打电话
//找回密码
export function findpwd(data) {
	return myRequest({
		url: '/login/forget',
		method: 'post',
		data:qs.stringify(data)
	})
}
//获取权限状态
export function getPowers() {
	return myRequest({
		url: '/member/power',
		method: 'get',
	})
}
//提交审核状态
export function submitcheck(url,data) {
	return myRequest({
		url: url,
		method: 'post',
		data:qs.stringify(data)
	})
}

